﻿using System;
using CommonLib;
namespace CommonDAL
{
    public interface IDataEntityFactory<TIdentity, TUniqueKey, TBusinessEntity, TDataEntity, TLazyEntity>
        where TIdentity : struct
        where TUniqueKey : struct
        where TBusinessEntity : class, IBusinessEntity<TUniqueKey>
        where TDataEntity : class, IDataEntity<TIdentity, TUniqueKey, TBusinessEntity>, TBusinessEntity
        where TLazyEntity : LazyDataEntity<TIdentity, TUniqueKey, TBusinessEntity, TDataEntity>, TBusinessEntity
    {
        TLazyEntity Create(TIdentity identity);
        TDataEntity Create(TBusinessEntity businessEntity);
        TDataEntity Create(TIdentity identity, TBusinessEntity businessEntity, long version);
    }

    public interface IDataEntityFactoryL<TUniqueKey, TBusinessEntity, TDataEntity, TLazyEntity> :
        IDataEntityFactory<long, TUniqueKey, TBusinessEntity, TDataEntity, TLazyEntity>
        where TUniqueKey : struct
        where TBusinessEntity : class, IBusinessEntity<TUniqueKey>
        where TDataEntity : class, IDataEntity<long, TUniqueKey, TBusinessEntity>, TBusinessEntity
        where TLazyEntity : LazyDataEntity<long, TUniqueKey, TBusinessEntity, TDataEntity>, TBusinessEntity
    {
    }
}
